<?php
class Login extends Model {
	function Login() {
		parent::Model();
	}
	var $table ='user';
	
	//cek table user apakah ada username atau password
	function check_user($username,$password) {
		$this->db->select('*');
		$this->db->from('user');
		$this->db->where('name =',$username);
		$this->db->where('pass =',md5($password));
		$this->db->where('status = "1"');
		$this->db->order_by('user_id','desc');
		return $this->db->get();
	}
	
		
	function insert_log($insert_log) 
	{
		$this->db->insert('transaction_log',$insert_log);
	}
	function show_id_trans_log() 
	{
		$this->db->select('*');
		$this->db->from('transaction_log');
		$this->db->order_by('id','desc');
		
		return $this->db->get();	
	}
}
?>